#ifndef __SLOTHTTPD_CONFIG_SERVER_HPP__
#define __SLOTHTTPD_CONFIG_SERVER_HPP__

#include <slothttpd/types.hpp>
#include <slothttpd/config/configuration.hpp>
#include <slothttpd/config/location/base_location.hpp>

#include <string>
#include <vector>
#include <ostream>

#include <boost/shared_ptr.hpp>
#include <boost/property_tree/ptree.hpp>

namespace slothttpd {
namespace config {

class server
{
public:
    server(const boost::property_tree::ptree &node, configuration &c);
    bool match_host(char_range_t host) const;
    
public:
    configuration              &conf;
    
    std::vector<std::string>    name;
    std::string                 path;
    std::string                 index;
    
    std::vector<location_ptr>   locations;
};

std::ostream &operator<<(std::ostream &os, const server &s);

}
}

#endif
